package com.wenson.structural.adapter;

/**
 * @ClassName: Adapter
 * @Author: luowangcheng
 * @Date: 2024/6/14 7:53
 * @Description:
 */
public class Adapter implements TriplePin {

    private DualPin dualPinDevice;

    // 创建适配器时，把两插设备接入进来
    public Adapter(DualPin dualPinDevice) {
        this.dualPinDevice = dualPinDevice;
    }

    @Override
    public void electrify(int l, int n, int e) {
        // 调用两插设备的通电方法，忽略地线参数
        dualPinDevice.electrify(l, n);
    }
}
